import service from '../../utils/request'
//验证码
export function userSendMail(payload = {}) {
    return service({
        url: '/user/sendMail',
        method: 'get',
        params: payload
    })
}
//登录
export function userLogin(payload = {}) {
    return service({
        url: '/user/login',
        method: 'post',
        data: payload
    })
}
//修改密码
export function modifyPassword(payload = {}) {
    return service({
        url: '/user/modifyPassword',
        method: 'post',
        data: payload
    })
}
//入库列表
export function enterList(payload = {}) {
    return service({
        url: '/getQurey',
        method: 'get',
        params: payload
    })
}
//新增入库
export function Addenter(payload = {}) {
    return service({
        url: '/insert',
        method: 'post',
        data: payload
    })
}
//搜索入库
export function SearchEnter(payload = {}) {
    return service({
        url: '/queryByNumberII',
        method: 'get',
        params: payload
    })
}
//出库列表
export function OutList(payload = {}) {
    return service({
        url: '/queryIO',
        method: 'get',
        params: payload
    })
}
//搜索出库
export function SearchOut(payload = {}) {
    return service({
        url: '/queryByNumberIO',
        method: 'get',
        params: payload
    })
}
//新增出库
export function AddOut(payload = {}) {
    return service({
        url: '/insertIO',
        method: 'post',
        data: payload
    })
}
//库存列表
export function stockList(payload = {}) {
    return service({
        url: '/queryI',
        method: 'get',
        params: payload
    })
}
//通品单品列表
export function filterList(payload = {}) {
    return service({
        url: '/selectBy',
        method: 'get',
        params: payload
    })
}
//条码搜索
export function stockSearch(payload = {}) {
    return service({
        url: '/selectByT',
        method: 'get',
        params: payload
    })
}
//基本信息上
export function infoTop(payload = {}) {
    return service({
        url: '/queryD',
        method: 'get',
        params: payload
    })
}
//基本信息下
export function infoBottom(payload = {}) {
    return service({
        url: '/queryID',
        method: 'get',
        params: payload
    })
}
//采购单列表
export function purchase(payload = {}) {
    return service({
        url: '/purchase',
        method: 'get',
        params: payload
    })
}
//新增采购单
export function Addpurchase(payload = {}) {
    return service({
        url: '/purchase',
        method: 'post',
        data: payload
    })
}
//删除采购单
export function Deletepurchase(payload = {}) {
    return service({
        url: `/purchase/${payload}`,
        method: 'delete',
        data: payload
    })
}
//修改采购单
export function Setpurchase(productId: any, payload: any) {
    return service({
        url: `/purchase/${productId}`,
        method: 'put',
        data: payload
    })
}
//需求列表
export function requireList(payload = {}) {
    return service({
        url: '/require',
        method: 'get',
        params: payload
    })
}
// //添加需求单
export function Addrequire(payload = {}) {
    return service({
        url: '/require',
        method: 'post',
        data: payload
    })
}
//修改需求单
export function Setrequire(productId: any, payload: any) {
    return service({
        url: `/require/${productId}`,
        method: 'put',
        data: payload


    })
}
//删除需求单
export function Deleterequire(payload = {}) {
    return service({
        url: `/require/${payload}`,
        method: 'delete',
        data: payload
    })
}
//分配列表
export function distributeList(payload = {}) {
    return service({
        url: '/distribute',
        method: 'get',
        params: payload
    })
}
//修改分配状态
export function SetdistributeList(productId: any, distributeListStatus: any) {
    return service({
        url: `/distribute`,
        method: 'put',
        data: {
            productId,
            distributeListStatus
        }
    })
}